﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace shenghua.Marketing.SalesPromotions.Dto
{
    public class CreateSalesPromotionDto
    {
        public string Name { get; set; }
        public DateTime BeginTime { get; set; }
        public int Hours { get; set; }
        public int Minutes { get; set; }
        public Double Price { get; set; }
        public List<int> AppliedCommodityIds { get; set; }
        public SalesPromotionTargetType TargetType { get; set; }

        public void MapTo(SalesPromotion obj)
        {
            obj.Name = Name;
            obj.BeginTime = BeginTime;
            obj.SetEndTime(Hours, Minutes);
            obj.Price = Price;
            obj.AppliedCommodityIds = new Common.CustomValueType.ValueArray<int>(AppliedCommodityIds);
            obj.TargetType = TargetType;
        }
    }
}
